package com.sinothk.gpserver.modules.texasPoker.demo;

import com.sinothk.gpserver.modules.texasPoker.helper.Poker;
import com.sinothk.gpserver.modules.texasPoker.helper.TexasPokerBean;
import com.sinothk.gpserver.modules.texasPoker.helper.TexasPokerHelper;

import java.util.ArrayList;
import java.util.List;

/**
 * 编写 Liang Y.T.
 * 时间 2021/6/28 23:07
 * 红桃k the king of hearts
 * 方块10 the ten of diamonds
 * 扑克牌中红桃（红心）、黑桃、方块（方片）及梅花（草花）分别用英语hearts、spades、diamonds及clubs表示。记住一定用复数。
 * 黑桃（spades）、红桃（hearts）、梅花（clubs）、方块（diamonds）
 * A读作ACE 复数是ACES
 * 2-9用正常数字读法 JQK分别读作Jack Queen King
 * 王为JOKER
 * 读完整扑克牌名时英语习惯先说数值后说花色
 */
public class XiPai {

    public static void main(String[] args) {
//        // 获取新扑克
//        Poker[] p = Poker.getNewPoker();
//        System.out.println("--------输出新扑克--------");
//        for (Poker poker : p) {
//            System.out.print(poker + "\t");
//        }
//
//        System.out.println();
//        // 获取洗牌
//        Poker[] ep = Poker.getEnablePoker(p);
//        System.out.println("--------输出洗牌后的扑克--------");
//        for (Poker poker : ep) {
//            System.out.print(poker + "\t");
////            if ((k + 1) % 13 == 0)
////                System.out.println();
//        }
//
//        System.out.println("\n--------发牌情况--------");
//        TexasPokerBean texasPokerBean = TexasPokerHelper.getStartPoker(p, 2);
//        System.out.println("参与人数：" + texasPokerBean.getPlayerNum());
//        System.out.println("发出去牌：");
//        texasPokerBean.getStartPokerList().forEach(poker -> {
//            System.out.print(poker + "\t");
//        });
//
//        System.out.println("\n每人得牌情况：");
//        for (int i = 0; i < texasPokerBean.getUserPokerList().size(); i++) {
//            List<Poker> userPoker = texasPokerBean.getUserPokerList().get(i);
//            System.out.println("\n第" + (i + 1) + "人：");
//            userPoker.forEach(poker -> {
//                System.out.print(poker + "\t");
//            });
//            System.out.println("");
//        }
//
//        System.out.println("\n公共牌：");
//        texasPokerBean.getPublicPokerList().forEach(poker -> {
//            System.out.print(poker + "\t");
//        });
//
//
//        System.out.println("\n\n发后余牌：");
//        texasPokerBean.getEndPokerList().forEach(poker -> {
//            System.out.print(poker + "\t");
//        });
//
//        // 发一次后
//        System.out.println("\n\n发1张一次后：");
//        TexasPokerHelper.runTimes(texasPokerBean, 1);
//
//        System.out.println("此时公共牌：");
//        for (int i = 0; i < texasPokerBean.getPublicPokerList().size(); i++) {
//            System.out.print(texasPokerBean.getPublicPokerList().get(i) + "\t");
//        }
//        System.out.println("\n此时余牌：");
//        for (Poker poker : texasPokerBean.getEndPokerList()) {
//            System.out.print(poker + "\t");
//        }
//
//        // 发二次后
//        System.out.println("\n\n发1张二次后：");
//        TexasPokerHelper.runTimes(texasPokerBean, 1);
//
//        System.out.println("此时公共牌：");
//        for (int i = 0; i < texasPokerBean.getPublicPokerList().size(); i++) {
//            System.out.print(texasPokerBean.getPublicPokerList().get(i) + "\t");
//        }
//        System.out.println("\n此时余牌：");
//        for (Poker poker : texasPokerBean.getEndPokerList()) {
//            System.out.print(poker + "\t");
//        }
//
//        // 每人得牌情况
//        System.out.println("\n此时每人得牌情况：");
//        ArrayList<Poker> pubList = texasPokerBean.getPublicPokerList();
//
//        for (ArrayList<Poker> personList : texasPokerBean.getUserPokerList()) {
//            personList.addAll(pubList);
//        }
//
//        for (int i = 0; i < texasPokerBean.getUserPokerList().size(); i++) {
//            ArrayList<Poker> userPoker = texasPokerBean.getUserPokerList().get(i);
//            System.out.println("\n第" + (i + 1) + "人：");
//            userPoker.forEach(poker -> {
//                System.out.print(poker + "\t");
//            });
//            System.out.println("");
//        }
//
//        ArrayList<Poker> p1Max = TexasPokerHelper.getMax5In7(texasPokerBean.getUserPokerList().get(0));
//        ArrayList<Poker> p2Max = TexasPokerHelper.getMax5In7(texasPokerBean.getUserPokerList().get(1));
    }
}
